package gmusic.command;

import gmusic.bo.QueryBean;
import gmusic.services.impl.GMusicServicesImpl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;

public class AfficherQueries implements Command {

	private final static Logger log = Logger.getLogger(AfficherQueries.class);

	public String execute(HttpServletRequest req) throws Exception {

		log.debug("AfficherQueries...");
		HttpSession session = req.getSession();

		List<QueryBean> queries = GMusicServicesImpl.getInstance().getQueries();

		session.setAttribute("queriesList", queries);

		return "/afficherQueries.jsp";
	}
}